import { Injectable } from '@angular/core';
// http 客户端
import { HttpClient } from '@angular/common/http'
enum Api {
  GET_USERS_API = '/api/v1/users?pageNum=0'
}
@Injectable({
  providedIn: 'root'
})

export class HomeService {
  
  constructor(
    private http: HttpClient
  ) { }
  // 获取文章列表 /api/v1/users?pageNum=0
  getHomeList() {
    console.log('dddddddd', this.http.get(Api.GET_USERS_API));
    
    return this.http.get(Api.GET_USERS_API, {
      // 请求的参数
      params: {
        page: -1
      }
    })
  }
}